<include file="header" />
<body>
<div class="wraper">
    <div class="header">
        <a href="javascript:history.go(-1);" class="iconfont icon-zuo back"></a>
        <div class="title text-center font-16">二维码读取测试</div>
    </div>
    <div class="main-card">
        <div class="user flex">
            <div class="logo">
                <img src="/assets/base/StoredValue/images/logo.png" alt="">
            </div>
        </div>
        <div class="bg-logo">
            <img src="/assets/base/StoredValue/images/logo.png" alt="">
        </div>
    </div>
    <div class="classify">
        <input id="readCode" type="text" value="" />
    </div>
    <a class="btn text-center font-16" id="scanQRCode">扫码</a>
</div>
</body>
<include file="loadding" />
<include file="commonJs" />
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript">
    wx.config({
        debug: false,
        appId: "{BEESCRM:$appid}",
        timestamp: "{BEESCRM:$timestamp}",
        nonceStr: "{BEESCRM:$noncestr}",
        signature: "{BEESCRM:$signature}",
        jsApiList: ['checkJsApi','scanQRCode']
    });
    wx.ready(function () {
        $('#scanQRCode').click(function () {
            wx.scanQRCode({
                needResult: 1, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
                scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码，默认二者都有
                success: function (res) {
                    var result = res.resultStr; // 当needResult 为 1 时，扫码返回的结果
                    $("#readCode").val(result);
                    $("#readCode").focus();
                }
            });
        });
    });
</script>
</html>